package cc.jorange.service.init;

import java.util.List;

import javax.annotation.PostConstruct;

import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.stereotype.Component;

import cc.jorange.bean.Permission;
import cc.jorange.bean.Poster;
import cc.jorange.bean.Role;
import cc.jorange.bean.User;
import cc.jorange.bean.Work;
import cc.jorange.common.Clock;
import cc.jorange.common.PasswordHelper;
import cc.jorange.dao.PermissionDao;
import cc.jorange.dao.PosterDao;
import cc.jorange.dao.RoleDao;
import cc.jorange.dao.UserDao;
import cc.jorange.dao.WorkDao;

import com.google.common.collect.Lists;

/**
 * 
 * @author Aaron
 *
 */
@Component
public class Init {

	private static final Logger logger = LoggerFactory.getLogger(Init.class);

	private Clock clock = Clock.DEFAULT;
	
	@Value("${system.password}")
	private String password;
	
	@Autowired
	private UserDao userDao;
	
	@Autowired
	private RoleDao roleDao;
	
	@Autowired
	private PermissionDao permissionDao;
	
	@Autowired
	private WorkDao workDao;
	@Autowired
	private PosterDao posterDao;

	@PostConstruct
	public void init() {
	}
	
	private void createSuperAdmin() {
		try {
			if (userDao.getUser("admin").size() == 0) {
				Permission permission = new Permission();
				permission.setId(1L);
				permission.setName("*:*:*");
				permission.setDescription("所有权限");
				permissionDao.save(permission);

				Role role = new Role();
				role.setId(1L);
				role.setName("administrator");
				role.setPermissions("*:*:*");
				roleDao.save(role);

				User user = new User();
				user.setId(1L);
				user.setLoginName("admin");
				user.setPlainPassword(password);
				user.setPassword(password);
				user.setName("系统管理员");
				user.setEmail("zhangyu0528@Jorange.com.cn");
				user.setRegisterDate(clock.getCurrentDate());

				List<Role> roleList = Lists.newArrayList();
				roleList.add(role);

				user.setRoleList(roleList);
				PasswordHelper.entryptPassword(user);
				userDao.save(user);
				logger.info("*****************");
				logger.info("*   创建超级管理员        *");
				logger.info("*****************");
			}
		} catch (Exception e) {
			logger.error("超级管理员创建失败,异常信息:", e);
		}
	}

	private void poster() {
		this.createPoster(1, "1", "1", "image/poster/1.png", 2L, 23);
		this.createPoster(2, "2", "2", "image/poster/2.png", 3L, 22);
		this.createPoster(3, "3", "3", "image/poster/3.png", 4L, 21);
		this.createPoster(4, "4", "4", "image/poster/4.png", 6L, 20);
		this.createPoster(5, "5", "5", "image/poster/5.png", 1L, 19);
		this.createPoster(7, "7", "7", "image/poster/7.png", 74L, 18);
		this.createPoster(8, "8", "8", "image/poster/8.png", 75L, 17);
		//new
		this.createPoster(10, "10", "10", "image/poster/10.png", 34L, 16);
		this.createPoster(11, "11", "11", "image/poster/11.png", 30L, 15);
		this.createPoster(12, "12", "12", "image/poster/12.png", 31L, 14);
		this.createPoster(13, "13", "13", "image/poster/13.png", 8L, 13);
		this.createPoster(14, "14", "14", "image/poster/14.png", 33L, 12);
		this.createPoster(15, "15", "15", "image/poster/15.png", 11L, 11);
		this.createPoster(16, "16", "16", "image/poster/16.png", 48L, 10);
		this.createPoster(17, "17", "17", "image/poster/17.png", 27L, 9);
		this.createPoster(18, "18", "18", "image/poster/18.png", 13L, 8);
		this.createPoster(19, "19", "19", "image/poster/19.png", 42L, 7);
		this.createPoster(20, "20", "20", "image/poster/20.png", 39L, 6);
	}
	
	private void works() {
		/*2015*/
		this.createWork(75L, "《小镇青年》音乐电影", "至上励合", "天娱传媒", "", "", "", "<embed src=\"http://player.yinyuetai.com/video/player/2458042/v_0.swf\" quality=\"high\" width=\"100%\" height=\"563px\" align=\"middle\"  allowScriptAccess=\"sameDomain\" allowfullscreen=\"true\" type=\"application/x-shockwave-flash\"></embed>", "2015/7.png", "type", "2015", "HOT,NEW");
		this.createWork(74L, "《大梦想家》", "TFBOYS","北京时代峰峻", "", "", "", "<embed src=\"http://player.yinyuetai.com/video/player/2445791/v_30319389.swf\" quality=\"high\" width=\"100%\" height=\"563px\" align=\"middle\"  allowScriptAccess=\"sameDomain\" allowfullscreen=\"true\" type=\"application/x-shockwave-flash\"></embed>", "2015/6.png", "type", "2015", "HOT,NEW");
		this.createWork(1L, "《TELL ME WHAT YOU WANT》", "韩庚", "乐华娱乐 庚心工作室", "", "", "", "<embed src=\"http://static.video.qq.com/TPout.swf?vid=v0170ng6hll&auto=0\" allowFullScreen=\"true\" quality=\"high\" width=\"100%\" height=\"563px\" align=\"middle\" allowScriptAccess=\"always\" type=\"application/x-shockwave-flash\"></embed>", "2015/1.png", "type", "2015", "");
		this.createWork(2L, "《深夜听歌流眼泪》", "韩庚","乐华娱乐 庚心工作室", "", "叶少琥：当时听 深夜听歌流眼泪 觉得是首深情歌曲..但 韩庚十年来 实在默默做了许多不为人知的公益，真心被暖到了，于是我 庚心 了创意。 现想起拍摄时还真挺幸运，京城周围都在下雨，我们却能在阳光下记录到 庚与孩子们的 欢乐.坚韧.纯真时刻。", "<ul><li>导演：叶少琥</li><li>摄影师：罗培</li><li>副导演：贺小爽</li><li>艺人服装：江南</li><li>演员服装：陈璐瑶</li><li>演员服装师助理：陈慧</li><li>制片人：陆鹿</li><li>执行制片：孙增强</li><li>美术：李昂</li><li>道具：小小马</li></ul>", "<embed src=\"http://static.video.qq.com/TPout.swf?vid=l0018remth6&auto=0\" allowFullScreen=\"true\" quality=\"high\" width=\"100%\" height=\"563px\" align=\"middle\" allowScriptAccess=\"always\" type=\"application/x-shockwave-flash\"></embed>", "2015/2.png", "type", "2015", "");
		this.createWork(3L, "《样YOUNG》", "TFBOYS", "北京时代峰峻", "MV中也融合一些具有特殊含义的物件，如千纸鹤、四叶草、小螃蟹、汤圆等。 MV以唯美的意境与富有故事性的场景，诠释了小小少年追梦情境。", "叶少琥：这次 Young 成长阶段，追逐梦想的三位少年，选择了同龄人不理解的方式生活，在面对选择、等待、遭遇误解的过程中，少年牺牲该有的简单生活 ，尽管如此少年们依然选择迎难而上，带着微笑，带着梦想让我们一起 Young 往梦的车站！", "<ul><li>导演：叶少琥</li><li>摄影师：杜祖武 </li><li>副导演：贺小爽</li><li>艺人服装：陈璐瑶</li><li>服装师助理：陈慧</li><li>制片人：陆鹿</li><li>执行制片：孙增强</li><li>美术：何登豪</li><li>道具：小可</li></ul>", "<embed src=\"http://player.yinyuetai.com/video/player/2278607/v_0.swf\" quality=\"high\" width=\"100%\" height=\"563px\" align=\"middle\"  allowScriptAccess=\"sameDomain\" allowfullscreen=\"true\" type=\"application/x-shockwave-flash\"></embed>", "2015/3.png", "type", "2015", "");
		this.createWork(4L, "《夏未央》", "罗云熙","中视同成", "罗云熙、陈永馨、若风的三角恋让人为之动容，MV剧情大打青春和纯爱牌，跌宕起伏，画面养眼，而MV设计的罗云熙生死未卜的开放式结局，引人无限遐想。聆听罗云熙《夏未央》 ，回忆每个人记忆中的那场冒险而不变的专属纯爱故事，爱不止，夏未央。", "叶少琥：<我们>的66长大了@罗云熙Leo 演技真是进步许多 [鲜花]#夏未央#这次水冷只能穿衣服下水！下次找个水热点的到时就..@Misaya若风lol 从此演艺圈多了个大...666 只要有台钢琴现场随时弹出动人旋律的女神...经第一次出演mv @Melody陈永馨 到底把 Leo 救上来了吗？", "<ul><li>导演：叶少琥</li><li>摄影师：罗培</li><li>副导演：贺小爽</li><li>艺人服装：陈璐瑶</li><li>服装师助理：陈慧</li><li>制片人：陆鹿</li><li>执行制片：孙增强</li><li>美术：李昂</li><li>道具：小小马</li></ul>", "<embed src=\"http://player.yinyuetai.com/video/player/2269938/v_0.swf\" quality=\"high\" width=\"100%\" height=\"563px\" align=\"middle\"  allowScriptAccess=\"sameDomain\" allowfullscreen=\"true\" type=\"application/x-shockwave-flash\"></embed>", "2015/4.png", "type", "2015", "");
		this.createWork(5L, "《莎里阿巴》", "艾菲", "盛强国际音乐", "艾菲  “唱跳女王”艾菲MV《莎里阿巴》重磅袭来。由叶少琥导演为艾菲度身定制的这只MV代表了内地乐坛的最高水平。此次MV的造型设计请到了国内最炙手可热的造型师陈星如，此支MV，在舞蹈设计方面也可谓是看点十足。艾菲团队不但邀请到全美国舞蹈冠军moon倾力加盟、为mv进行编舞；还有曾为无数欧美大牌艺人出镜伴舞的全美冠军philip参演、国内知名party厂牌，one party group的舞蹈团队及kod冠军rmb crew的加入，堪称国内有史以来最强的舞蹈阵容。", "", "<ul><li>导演：叶少琥</li><li>摄影师：杜祖武</li><li>副导演：贺小爽</li><li>艺人服装：陈星如</li><li>美术：何登豪</li><li>道具：卢微</li></ul>", "<embed src=\"http://player.yinyuetai.com/video/player/2232155/v_0.swf\" quality=\"high\" width=\"100%\" height=\"563px\" align=\"middle\"  allowScriptAccess=\"sameDomain\" allowfullscreen=\"true\" type=\"application/x-shockwave-flash\"></embed>", "2015/5.png", "type", "2015", "");
		/*2014*/
		this.createWork(6L, "《信仰之名》", "TFBOYS","北京时代峰峻", "MV讲述在赛车场风驰电掣并力求完美的职业赛车手TFBOYS在追求梦想的过程中努力拼搏、并与黑暗势力斗争的故事。为此三名成员造型上根据剧情共换装6次，瞬时从萌乖牌的清新路线转变为凌厉风行的热血少年。", "叶少琥：音悦台@华语音悦Tai 榜单蝉联14周佳绩TFBOYS @TFBOYS组合 四叶草们真是顽强的《幸运符号》逆境之中体现出坚韧不拔的精神 就像那生长在井盖旁却会发光的四叶草 任\"信\"绽放\"机器们\" 老地方见 TFBOYS 《信仰之名》 @TFBOYS-王俊凯 @TFBOYS-王源 @TFBOYS-易烊千玺", "<ul><li>导演：叶少琥</li><li>摄影师：杜祖武</li><li>副导演：贺小爽</li><li>艺人服装：陈璐瑶 </li><li>服装师助理：陈慧</li><li>美术：何登豪</li><li>道具：卢微</li></ul>", "<embed src=\"http://player.yinyuetai.com/video/player/2209616/v_0.swf\" quality=\"high\" width=\"100%\" height=\"563px\" align=\"middle\"  allowScriptAccess=\"sameDomain\" allowfullscreen=\"true\" type=\"application/x-shockwave-flash\"></embed>", "2014/1.png", "type", "2014", "");
		this.createWork(7L, "《FLY AWAY》 ", "檀健次","太合麦田", "《Fly Away》MV依然邀请到和MIC男团合作默契的导演叶少琥掌镜，通过其最擅长的创意性手法为檀健次量身打造。这部充满时装大片即视觉的MV，创意与艺术性也提升到新的高度，刻有FLY AWAY字样的刀片，魔鬼容器的白色液体，铺满高跟鞋的白色浴缸等等，冰冷又具有意象性的物品代表着不同的寓意，让整个痛彻心扉的气氛都更加浓重。在MV中极重的突出了檀健次的脸部特写，深刻表达了愤怒、伤心、绝望、惆怅等情绪。而最大的亮点则是檀健次的独舞镜头，本就舞蹈功底的他更是对自己做了更严苛的挑战，全程参与舞蹈部分的所有编排过程。", "", "<ul><li>导演：叶少琥</li><li>摄影师：杜祖武</li><li>副导演：贺小爽</li><li>艺人服装：陈璐瑶 </li><li>服装师助理：秦川</li><li>美术：何登豪</li></ul>", "<embed src=\"http://player.yinyuetai.com/video/player/2198640/v_0.swf\" quality=\"high\" width=\"100%\" height=\"563px\" align=\"middle\"  allowScriptAccess=\"sameDomain\" allowfullscreen=\"true\" type=\"application/x-shockwave-flash\"></embed>", "2014/2.png", "type", "2014", "");
		this.createWork(8L, "《鸭梨大》", "至上励合","天娱传媒", "在拍摄《鸭梨大》MV时，连续20小时不间断的拍摄让四位成员直呼“鸭梨好大！”MV中，四位成员半裸出镜，身上的泡沫图案更是临场发挥肆意涂抹的杰作。拍摄复古小轿车的场景时，为呈现最终朦胧质感的特效，导演组放了大量的烟雾，甚至让现场工作人员都睁不开眼睛，但四位成员依旧玩的很high，顽皮男孩本性一览无余。配合《鸭梨大》的绕梁旋律，至上励合更是自创解压舞，精心设计的舞蹈动作配上朗朗上口的旋律和歌词，带领全民解压show起来。偶像不仅是帅酷耍范儿，更应该将正面的能量传播出去，影响更多的人，带动更多的人勇于改变，遇到更好的自己。", "", "<ul><li>导演：叶少琥</li><li>摄影师：罗培</li><li>副导演：贺小爽</li><li>美术：何登豪</li><li>道具：卢微</li></ul>", "<embed src=\"http://player.yinyuetai.com/video/player/2180821/v_0.swf\" quality=\"high\" width=\"100%\" height=\"563px\" align=\"middle\"  allowScriptAccess=\"sameDomain\" allowfullscreen=\"true\" type=\"application/x-shockwave-flash\"></embed>", "2014/3.png", "type", "2014", "");
		this.createWork(9L, "《魔鬼的礼物》", "EVA","当然娱乐", "", "", "", "<embed src=\"http://player.yinyuetai.com/video/player/2160767/v_0.swf\" quality=\"high\" width=\"100%\" height=\"563px\" align=\"middle\"  allowScriptAccess=\"sameDomain\" allowfullscreen=\"true\" type=\"application/x-shockwave-flash\"></embed>", "2014/4.png", "type", "2014", "");
		this.createWork(10L, "《好了》", "EVA","当然娱乐", "", "", "", "<embed src=\"http://player.yinyuetai.com/video/player/2173873/v_0.swf\" quality=\"high\" width=\"100%\" height=\"563px\" align=\"middle\"  allowScriptAccess=\"sameDomain\" allowfullscreen=\"true\" type=\"application/x-shockwave-flash\"></embed>", "2014/5.png", "type", "2014", "");
		this.createWork(11L, "《幸运符号》", "TFBOYS","北京时代峰峻", "TFBOYS全新专辑中第二支单曲《幸运符号》MV！MV由叶少琥导演，和TFBOYS以往MV不同的是，本次全部场景由积木搭设，从汽车，家具到电话，茶杯，相机等，都充满着甜蜜的童话色彩。本次MV讲述的也是积木世界不快乐的积木人是如何在TFBOYS的感染下，拿到幸运符号而重新开始微笑的故事。而MV中不时出现的积木版四叶草似乎也在向所有粉丝说明，四叶草就是TFBOYS的幸运符号。", "叶少琥：@TFBOYS组合 @TFBOYS-王俊凯 @TFBOYS-王源 @TFBOYS-易烊千玺 堅持夢想！不斷努力！<幸運符號>就在你身邊The Fighting Boys！", "<ul><li>导演：叶少琥 </li><li>摄影师：杜祖武 </li><li>副导演：贺小爽</li><li>美术：何登豪</li><li>道具：小可</li></ul>", "<embed src=\"http://player.yinyuetai.com/video/player/2140901/v_0.swf\" quality=\"high\" width=\"100%\" height=\"563px\" align=\"middle\"  allowScriptAccess=\"sameDomain\" allowfullscreen=\"true\" type=\"application/x-shockwave-flash\"></embed>", "2014/6.png", "type", "2014", "");
		this.createWork(12L, "《不想见你》", "赵泳鑫","太合麦田", "", "", "", "<embed src=\"http://player.yinyuetai.com/video/player/2121144/v_0.swf\" quality=\"high\" width=\"100%\" height=\"563px\" align=\"middle\"  allowScriptAccess=\"sameDomain\" allowfullscreen=\"true\" type=\"application/x-shockwave-flash\"></embed>", "2014/7.png", "type", "2014", "");
		this.createWork(13L, "《青春修炼手册》", "TFBOYS","北京时代峰峻", "", "", "", "<embed src=\"http://player.yinyuetai.com/video/player/2116526/v_0.swf\" quality=\"high\" width=\"100%\" height=\"563px\" align=\"middle\"  allowScriptAccess=\"sameDomain\" allowfullscreen=\"true\" type=\"application/x-shockwave-flash\"></embed>", "2014/8.png", "type", "2014", "");
		this.createWork(14L, "《Super Daddy》", "赵泳鑫","太合麦田", "《Super Daddy》MV请到曾为MIC男团拍摄过《Single Ladies》、《Get It Hot》以及《Rock Star》知名导演叶少琥，呈现出高标准的制作水平和创意，向众人展示一个突破过往的赵泳鑫，也为接下来的成员SOLO计划开启完美序幕。此次赵泳鑫尝试更多突破，七套重磅造型打造七种不同形象的赵泳鑫，与众多国际一线服装品牌的合作，让快速换装成为了MV的看点之一，突破性的舞蹈表现也是MV的另一亮点，配合巧妙设计感的场景，画面感冲击力十足。MV中Bass自然成为了当之无愧的“男主角”，作为频繁登上热门话题榜的宠物明星，Bass表演实力不容小觑。在完整版的《Super Daddy》MV中，Bass不论是从天而降的霸气登场以及天生对镜头的敏感度，它的超然表现都为MV加分不少。据悉，公司更因为Bass在MV中需要吊威亚的高难度镜头，而为其重金购买保险。", "", "<ul><li>导演：叶少琥</li><li>摄影师：杜祖武</li><li>副导演：陈志原</li><li>美术：何登豪</li></ul>", "<embed src=\"http://player.yinyuetai.com/video/player/2097505/v_0.swf\" quality=\"high\" width=\"100%\" height=\"563px\" align=\"middle\"  allowScriptAccess=\"sameDomain\" allowfullscreen=\"true\" type=\"application/x-shockwave-flash\"></embed>", "2014/9.png", "type", "2014", "");
		this.createWork(15L, "《盛开》", "玖月奇迹","百娱经纪", "", "", "", "<embed src=\"http://player.yinyuetai.com/video/player/2071243/v_0.swf\" quality=\"high\" width=\"100%\" height=\"563px\" align=\"middle\"  allowScriptAccess=\"sameDomain\" allowfullscreen=\"true\" type=\"application/x-shockwave-flash\"></embed>", "2014/10.png", "type", "2014", "");
		this.createWork(16L, "《DON'T YOU LET ME GO》", "愛戴","爱联社国际", "", "", "", "<embed src=\"http://player.yinyuetai.com/video/player/2004441/v_0.swf\" quality=\"high\" width=\"100%\" height=\"563px\" align=\"middle\"  allowScriptAccess=\"sameDomain\" allowfullscreen=\"true\" type=\"application/x-shockwave-flash\"></embed>", "2014/11.png", "type", "2014", "");
		/*2013*/
		this.createWork(17L, "《名媛》", "愛戴","爱联社国际", "", "", "", "<embed src=\"http://player.yinyuetai.com/video/player/839341/v_0.swf\" quality=\"high\" width=\"100%\" height=\"563px\" align=\"middle\"  allowScriptAccess=\"sameDomain\" allowfullscreen=\"true\" type=\"application/x-shockwave-flash\"></embed>", "2013/1.png", "type", "2013", "");
		this.createWork(18L, "《绝不呼救》", "金志文","恒大音乐", "", "", "", "<embed src=\"http://player.yinyuetai.com/video/player/819414/v_0.swf\" quality=\"high\" width=\"100%\" height=\"563px\" align=\"middle\"  allowScriptAccess=\"sameDomain\" allowfullscreen=\"true\" type=\"application/x-shockwave-flash\"></embed>", "2013/2.png", "type", "2013", "");
		this.createWork(19L, "《心心锁》", "愛戴","爱联社国际", "", "", "", "<embed src=\"http://player.yinyuetai.com/video/player/809118/v_0.swf\" quality=\"high\" width=\"100%\" height=\"563px\" align=\"middle\"  allowScriptAccess=\"sameDomain\" allowfullscreen=\"true\" type=\"application/x-shockwave-flash\"></embed>", "2013/3.png", "type", "2013", "");
		this.createWork(20L, "《花花世界》", "刘忻","天娱传媒", "", "", "", "<embed src=\"http://player.yinyuetai.com/video/player/768032/v_0.swf\" quality=\"high\" width=\"100%\" height=\"563px\" align=\"middle\"  allowScriptAccess=\"sameDomain\" allowfullscreen=\"true\" type=\"application/x-shockwave-flash\"></embed>", "2013/4.png", "type", "2013", "");
		this.createWork(21L, "《我这样的女人》", "汪妤凌","华音鼎天", "", "", "", "<embed src=\"http://player.yinyuetai.com/video/player/739495/v_0.swf\" quality=\"high\" width=\"100%\" height=\"563px\" align=\"middle\"  allowScriptAccess=\"sameDomain\" allowfullscreen=\"true\" type=\"application/x-shockwave-flash\"></embed>", "2013/5.png", "type", "2013", "");
		this.createWork(22L, "《SINGLE LADIES》", "MIC男团","太合麦田", "", "", "", "<embed src=\"http://player.yinyuetai.com/video/player/722311/v_0.swf\" quality=\"high\" width=\"100%\" height=\"563px\" align=\"middle\"  allowScriptAccess=\"sameDomain\" allowfullscreen=\"true\" type=\"application/x-shockwave-flash\"></embed>", "2013/6.png", "type", "2013", "");
		this.createWork(23L, "《最佳恋爱》", "邹容","北京环球唱片", "", "", "", "<embed src=\"http://player.yinyuetai.com/video/player/721437/v_0.swf\" quality=\"high\" width=\"100%\" height=\"563px\" align=\"middle\"  allowScriptAccess=\"sameDomain\" allowfullscreen=\"true\" type=\"application/x-shockwave-flash\"></embed>", "2013/7.png", "type", "2013", "");
		this.createWork(24, "《背面》", "汪妤凌","华音鼎天", "", "", "", "<embed src=\"http://player.yinyuetai.com/video/player/695370/v_0.swf\" quality=\"high\" width=\"100%\" height=\"563px\" align=\"middle\"  allowScriptAccess=\"sameDomain\" allowfullscreen=\"true\" type=\"application/x-shockwave-flash\"></embed>", "2013/8.png", "type", "2013", "");
		this.createWork(25L, "《玉生烟》", "七朵","华音世纪", "", "", "", "<embed src=\"http://player.yinyuetai.com/video/player/692888/v_0.swf\" quality=\"high\" width=\"100%\" height=\"563px\" align=\"middle\"  allowScriptAccess=\"sameDomain\" allowfullscreen=\"true\" type=\"application/x-shockwave-flash\"></embed>", "2013/9.png", "type", "2013", "");
		this.createWork(26L, "《铆钉》", "汪妤凌","华音鼎天", "", "", "", "<embed src=\"http://player.yinyuetai.com/video/player/679427/v_0.swf\" quality=\"high\" width=\"100%\" height=\"563px\" align=\"middle\"  allowScriptAccess=\"sameDomain\" allowfullscreen=\"true\" type=\"application/x-shockwave-flash\"></embed>", "2013/10.png", "type", "2013", "");
		this.createWork(27L, "《范儿》", "汪妤凌","华音鼎天", "", "", "", "<embed src=\"http://player.yinyuetai.com/video/player/658125/v_0.swf\" quality=\"high\" width=\"100%\" height=\"563px\" align=\"middle\"  allowScriptAccess=\"sameDomain\" allowfullscreen=\"true\" type=\"application/x-shockwave-flash\"></embed>", "2013/11.png", "type", "2013", "");
		this.createWork(28L, "《NAMI GIRL》", "NAMI","乘黄天际", "", "", "", "<embed src=\"http://player.yinyuetai.com/video/player/621786/v_0.swf\" quality=\"high\" width=\"100%\" height=\"563px\" align=\"middle\"  allowScriptAccess=\"sameDomain\" allowfullscreen=\"true\" type=\"application/x-shockwave-flash\"></embed>", "2013/12.png", "type", "2013", "");
		/*2012*/
		this.createWork(29L, "《FIGHTING GIRL》", "爱戴","爱联社国际", "", "", "", "<embed src=\"http://player.yinyuetai.com/video/player/569597/v_0.swf\" quality=\"high\" width=\"100%\" height=\"563px\" align=\"middle\"  allowScriptAccess=\"sameDomain\" allowfullscreen=\"true\" type=\"application/x-shockwave-flash\"></embed>", "2012/1.png", "type", "2012", "");
		this.createWork(30L, "《最佳听众》", "韩庚&萧亚轩","乐华娱乐", "", "", "", "<embed src=\"http://player.yinyuetai.com/video/player/479779/v_0.swf\" quality=\"high\" width=\"100%\" height=\"563px\" align=\"middle\"  allowScriptAccess=\"sameDomain\" allowfullscreen=\"true\" type=\"application/x-shockwave-flash\"></embed>", "2012/2.png", "type", "2012", "");
		this.createWork(31L, "《我们》", "双孖JL","杰家传媒", "", "", "", "<embed src=\"http://player.yinyuetai.com/video/player/470715/v_0.swf\" quality=\"high\" width=\"100%\" height=\"563px\" align=\"middle\"  allowScriptAccess=\"sameDomain\" allowfullscreen=\"true\" type=\"application/x-shockwave-flash\"></embed>", "2012/3.png", "type", "2012", "");
		this.createWork(32L, "《JL》", "双孖JL","杰家传媒", "", "", "", "<embed src=\"http://player.yinyuetai.com/video/player/419454/v_0.swf\" quality=\"high\" width=\"100%\" height=\"563px\" align=\"middle\"  allowScriptAccess=\"sameDomain\" allowfullscreen=\"true\" type=\"application/x-shockwave-flash\"></embed>", "2012/4.png", "type", "2012", "");
		/*2011*/
		this.createWork(33L, "《GET IT HOT》", "MIC男团","太合麦田", "", "", "", "<embed src=\"http://player.yinyuetai.com/video/player/293422/v_0.swf\" quality=\"high\" width=\"100%\" height=\"563px\" align=\"middle\"  allowScriptAccess=\"sameDomain\" allowfullscreen=\"true\" type=\"application/x-shockwave-flash\"></embed>", "2011/1.png", "type", "2011", "");
		this.createWork(34L, "《我唱啦啦啦》", "李宇春","天娱传媒", "", "", "", "<embed src=\"http://player.yinyuetai.com/video/player/189119/v_0.swf\" quality=\"high\" width=\"100%\" height=\"563px\" align=\"middle\"  allowScriptAccess=\"sameDomain\" allowfullscreen=\"true\" type=\"application/x-shockwave-flash\"></embed>", "2011/2.png", "type", "2011", "");
		/*2010*/
		this.createWork(35L, "《ROCKSTAR》", "MIC男团","太合麦田", "", "", "", "<embed src=\"http://player.yinyuetai.com/video/player/89600/v_0.swf\" quality=\"high\" width=\"100%\" height=\"563px\" align=\"middle\"  allowScriptAccess=\"sameDomain\" allowfullscreen=\"true\" type=\"application/x-shockwave-flash\"></embed>", "2010/1.png", "type", "2010", "");
		this.createWork(36L, "《 真材实料的我》", "林俊杰","华纳唱片", "", "", "", "<embed src=\"http://player.video.qiyi.com/aa3643cc4650baa780cf5f0615b54286/0/0/w_19rrv706nl.swf-albumId=4261458909-tvId=4261458909-isPurchase=0-cnId=5\" allowFullScreen=\"true\" quality=\"high\" width=\"100%\" height=\"563px\" align=\"middle\" allowScriptAccess=\"always\" type=\"application/x-shockwave-flash\"></embed>", "2010/2.png", "type", "2010", "");
		this.createWork(37L, "《戴眼镜的女孩》", "周笔畅","华纳唱片", "", "", "", "<embed src=\"http://player.yinyuetai.com/video/player/45818/v_0.swf\" quality=\"high\" width=\"100%\" height=\"563px\" align=\"middle\"  allowScriptAccess=\"sameDomain\" allowfullscreen=\"true\" type=\"application/x-shockwave-flash\"></embed>", "2010/3.png", "type", "2010", "");
		/*2009*/
		this.createWork(70L, "《放假了》", "张含韵","天娱传媒", "", "", "", "<embed src=\"http://player.yinyuetai.com/video/player/12138/v_0.swf\" quality=\"high\" width=\"100%\" height=\"563px\" align=\"middle\"  allowScriptAccess=\"sameDomain\" allowfullscreen=\"true\" type=\"application/x-shockwave-flash\"></embed>", "2009/1.png", "type", "2009", "");
		this.createWork(71L, "《别爱我像爱个朋友》", "周笔畅","金牌大风", "", "", "", "<embed src=\"http://player.yinyuetai.com/video/player/4984/v_0.swf\" quality=\"high\" width=\"100%\" height=\"563px\" align=\"middle\"  allowScriptAccess=\"sameDomain\" allowfullscreen=\"true\" type=\"application/x-shockwave-flash\"></embed>", "2009/2.png", "type", "2009", "");
		this.createWork(72L, "《silence》", "周笔畅","金牌大风", "", "", "", "<embed src=\"http://player.yinyuetai.com/video/player/2637/v_0.swf\" quality=\"high\" width=\"100%\" height=\"563px\" align=\"middle\"  allowScriptAccess=\"sameDomain\" allowfullscreen=\"true\" type=\"application/x-shockwave-flash\"></embed>", "2009/3.png", "type", "2009", "");
		this.createWork(73L, "《属于》", "范晓萱","音华娱乐", "", "", "", "<embed src=\"http://player.yinyuetai.com/video/player/6/v_0.swf\" quality=\"high\" width=\"100%\" height=\"563px\" align=\"middle\"  allowScriptAccess=\"sameDomain\" allowfullscreen=\"true\" type=\"application/x-shockwave-flash\"></embed>", "2009/4.png", "type", "2009", "");
		this.createWork(38L, "《反复》", "周笔畅", "金牌大风", "", "", "", "<embed width=\"100%\" height=\"563px\" wmode=\"Transparent\" allowfullscreen=\"true\" allowscriptaccess=\"always\" quality=\"high\" src=\"http://share.vrs.sohu.com/1320635/v.swf&topBar=1&autoplay=false&plid=1005245&pub_catecode=0&from=page\" type=\"application/x-shockwave-flash\"/></embed>", "other/1.png", "type", "2009", "");
		/*...*/
		this.createWork(39L, "《DO.RE.ME》", "旺福乐团", "", "", "", "", "<embed src=\"http://player.video.qiyi.com/beaa151b0736862420a1fc186d27f870/0/0/w_19rqr5aj9l.swf-albumId=1852651109-tvId=1852651109-isPurchase=0-cnId=5\" allowFullScreen=\"true\" quality=\"high\" width=\"100%\" height=\"563px\" align=\"middle\" allowScriptAccess=\"always\" type=\"application/x-shockwave-flash\"></embed>", "other/2.png", "type", "other", "");
		this.createWork(40L, "《2008》", "杨坤",  "","", "", "", "<embed src=\"http://player.youku.com/player.php/sid/XNzQxMzYxMg==/v.swf\" allowFullScreen=\"true\" quality=\"high\" width=\"100%\" height=\"563px\" align=\"middle\" allowScriptAccess=\"always\" type=\"application/x-shockwave-flash\"></embed>", "other/3.png", "type", "other", "");
		this.createWork(41L, "《jeep 情人》", "杨坤", "", "", "", "", "<embed src=\"http://player.ku6.com/refer/0idnzpa2fjKPTMOq/v.swf\" width=\"100%\" height=\"563px\" allowscriptaccess=\"always\" allowfullscreen=\"true\" type=\"application/x-shockwave-flash\" flashvars=\"from=ku6\"></embed>", "other/4.png", "type", "other", "");
		this.createWork(42L, "《恋爱长崎》", "杨坤", "", "", "", "", "<embed src=\"http://player.56.com/v_MjUwNDI2NzQ.swf\" type=\"application/x-shockwave-flash\" width=\"100%\" height=\"563px\" allowfullscreen=\"true\" allownetworking=\"all\" allowscriptaccess=\"always\"></embed>", "other/5.png", "type", "other", "");
		this.createWork(43L, "《不要告别》", "杨坤", "", "", "", "", "<embed width=\"100%\" height=\"563px\" wmode=\"Transparent\" allowfullscreen=\"true\" allowscriptaccess=\"always\" quality=\"high\" src=\"http://share.vrs.sohu.com/1173360/v.swf&topBar=1&autoplay=false&plid=1005800&pub_catecode=0&from=page\" type=\"application/x-shockwave-flash\"/></embed>", "other/6.png", "type", "other", "");
		this.createWork(44L, "《骄傲飞翔》", "杨坤&张靓颖", "", "", "", "", "<embed src=\"http://player.youku.com/player.php/sid/XMzQyMjgyMzYw/v.swf\" allowFullScreen=\"true\" quality=\"high\" width=\"100%\" height=\"563px\" align=\"middle\" allowScriptAccess=\"always\" type=\"application/x-shockwave-flash\"></embed>", "other/7.png", "type", "other", "");
		this.createWork(45L, "《面对》", "雅安赈灾公益", "", "", "", "", "<embed pluginspage=\"http://www.macromedia.com/go/getflashplayer\" src=\"http://video.sina.com.cn/share/video/202657629.swf\" type=\"application/x-shockwave-flash\" name=\"ssss\" allowFullScreen=\"true\" allowScriptAccess=\"always\" width=\"100%\" height=\"563px\"></embed>", "other/8.png", "type", "other", "");
		this.createWork(46L, "《化骨绵掌》", "谢娜", "", "", "", "", "<embed src=\"http://player.56.com/v_Njk4NTYzMTc.swf\" type=\"application/x-shockwave-flash\" width=\"100%\" height=\"563px\" allowfullscreen=\"true\" allownetworking=\"all\" allowscriptaccess=\"always\"></embed>", "other/9.png", "type", "other", "");
		this.createWork(47L, "《听见牛在哭》", "阿杜", "", "", "", "", "<embed src=\"http://player.video.qiyi.com/e5451deff1140d534584ff81678185b5/0/0/w_19rqtz0wx1.swf-albumId=2017131209-tvId=2017131209-isPurchase=0-cnId=5\" allowFullScreen=\"true\" quality=\"high\" width=\"100%\" height=\"563px\" align=\"middle\" allowScriptAccess=\"always\" type=\"application/x-shockwave-flash\"></embed>", "other/10.png", "type", "other", "");
		this.createWork(48L, "《人狼》", "阿杜", "", "", "", "", "<embed src=\"http://player.yinyuetai.com/video/player/68373/v_0.swf\" quality=\"high\" width=\"100%\" height=\"563px\" align=\"middle\"  allowScriptAccess=\"sameDomain\" allowfullscreen=\"true\" type=\"application/x-shockwave-flash\"></embed>", "other/11.png", "type", "other", "");
		this.createWork(49L, "《还你自由》", "阿杜", "", "", "", "", "<embed width=\"100%\" height=\"563px\" wmode=\"Transparent\" allowfullscreen=\"true\" allowscriptaccess=\"always\" quality=\"high\" src=\"http://share.vrs.sohu.com/my/v.swf&topBar=1&id=68025073&autoplay=false&from=page\" type=\"application/x-shockwave-flash\"/></embed>", "other/12.png", "type", "other", "");
		this.createWork(50L, "《世界之大》", "BOBO", "", "", "", "", "<embed width=\"100%\" height=\"563px\" wmode=\"Transparent\" allowfullscreen=\"true\" allowscriptaccess=\"always\" quality=\"high\" src=\"http://share.vrs.sohu.com/my/v.swf&topBar=1&id=31022398&autoplay=false&from=page\" type=\"application/x-shockwave-flash\"/></embed>", "other/13.png", "type", "other", "");
		this.createWork(51L, "《大明星》", "BOBO", "", "", "", "", "<embed width=\"100%\" height=\"563px\" wmode=\"Transparent\" allowfullscreen=\"true\" allowscriptaccess=\"always\" quality=\"high\" src=\"http://share.vrs.sohu.com/my/v.swf&topBar=1&id=66924582&autoplay=false&from=page\" type=\"application/x-shockwave-flash\"/></embed>", "other/14.png", "type", "other", "");
		this.createWork(52L, "《时刻准备着》", "BOBO", "", "", "", "", "<embed src=\"http://player.video.qiyi.com/8a791878c1c489b01a413473918353d0/0/0/w_19rqzqwhsd.swf-albumId=1332359009-tvId=1332359009-isPurchase=0-cnId=5\" allowFullScreen=\"true\" quality=\"high\" width=\"100%\" height=\"563px\" align=\"middle\" allowScriptAccess=\"always\" type=\"application/x-shockwave-flash\"></embed>", "other/15.png", "type", "other", "");
		this.createWork(53L, "《再见时光》", "丛浩楠", "", "", "", "", "<embed src=\"http://player.video.qiyi.com/1575e296fe8511dfaa6aa4badb2c35a1/0/0/yinyue/20100709/n23943.swf-albumId=3098-tvId=20950-isPurchase=0-cnId=5\" allowFullScreen=\"true\" quality=\"high\" width=\"100%\" height=\"563px\" align=\"middle\" allowScriptAccess=\"always\" type=\"application/x-shockwave-flash\"></embed>", "other/16.png", "type", "other", "");
		this.createWork(54L, "《我的太阳》", "丛浩楠", "", "", "", "", "<embed src=\"http://player.video.qiyi.com/1575df44fe8511dfaa6aa4badb2c35a1/0/0/yinyue/20100709/n23944.swf-albumId=3115-tvId=20948-isPurchase=0-cnId=5\" allowFullScreen=\"true\" quality=\"high\" width=\"100%\" height=\"563px\" align=\"middle\" allowScriptAccess=\"always\" type=\"application/x-shockwave-flash\"></embed>", "other/17.png", "type", "other", "");
		this.createWork(55L, "《笨蛋》", "金莎", "", "", "", "", "<embed width=\"100%\" height=\"563px\" wmode=\"Transparent\" allowfullscreen=\"true\" allowscriptaccess=\"always\" quality=\"high\" src=\"http://share.vrs.sohu.com/1220818/v.swf&topBar=1&autoplay=false&plid=1006883&pub_catecode=0&from=page\" type=\"application/x-shockwave-flash\"/></embed>", "other/18.png", "type", "other", "");
		this.createWork(56L, "《非诚勿扰》", "巩新亮", "", "", "", "", "<embed src=\"http://player.youku.com/player.php/sid/XODI3MTEzMDA=/v.swf\" allowFullScreen=\"true\" quality=\"high\" width=\"100%\" height=\"563px\" align=\"middle\" allowScriptAccess=\"always\" type=\"application/x-shockwave-flash\"></embed>", "other/19.png", "type", "other", "");
		this.createWork(57L, "《人间》", "羽泉", "", "", "", "", "<embed width=\"100%\" height=\"563px\" wmode=\"Transparent\" allowfullscreen=\"true\" allowscriptaccess=\"always\" quality=\"high\" src=\"http://share.vrs.sohu.com/my/v.swf&topBar=1&id=53456555&autoplay=false&from=page\" type=\"application/x-shockwave-flash\"/></embed>", "other/20.png", "type", "other", "");
		this.createWork(58L, "《海上的岛》", "伍佰&范晓萱", "", "", "", "", "<embed width=\"100%\" height=\"563px\" wmode=\"Transparent\" allowfullscreen=\"true\" allowscriptaccess=\"always\" quality=\"high\" src=\"http://share.vrs.sohu.com/my/v.swf&topBar=1&id=30032898&autoplay=false&from=page\" type=\"application/x-shockwave-flash\"/></embed>", "other/21.png", "type", "other", "");
		this.createWork(59L, "《party days》", "魏如昀", "", "", "", "", "<embed src=\"http://player.yinyuetai.com/video/player/747242/v_0.swf\" quality=\"high\" width=\"100%\" height=\"563px\" align=\"middle\"  allowScriptAccess=\"sameDomain\" allowfullscreen=\"true\" type=\"application/x-shockwave-flash\"></embed>", "other/22.png", "type", "other", "");
		this.createWork(60L, "《阿公的眠床脚》", "江蕙", "", "", "", "", "<embed src=\"http://www.tudou.com/v/V9Io0eHA25A/&bid=05&resourceId=0_05_05_99/v.swf\" type=\"application/x-shockwave-flash\" allowscriptaccess=\"always\" allowfullscreen=\"true\" wmode=\"opaque\" width=\"100%\" height=\"563px\"></embed>", "other/23.png", "type", "other", "");
		this.createWork(61L, "《博杯》", "江蕙", "",  "","", "", "<embed src=\"http://player.ku6.com/refer/aZf6sAw6pLSD163T/v.swf\" width=\"100%\" height=\"563px\" allowscriptaccess=\"always\" allowfullscreen=\"true\" type=\"application/x-shockwave-flash\" flashvars=\"from=ku6\"></embed>", "other/24.png", "type", "other", "");
		this.createWork(62L, "《守候》", "5566", "", "", "", "", "<embed src=\"http://player.56.com/v_MTExOTA2NDc3.swf\" type=\"application/x-shockwave-flash\" width=\"100%\" height=\"563px\" allowfullscreen=\"true\" allownetworking=\"all\" allowscriptaccess=\"always\"></embed>", "other/25.png", "type", "other", "");
		this.createWork(63L, "《最爱是你》", "Kone", "", "", "", "", "<embed width=\"100%\" height=\"563px\" wmode=\"Transparent\" allowfullscreen=\"true\" allowscriptaccess=\"always\" quality=\"high\" src=\"http://share.vrs.sohu.com/my/v.swf&topBar=1&id=18206588&autoplay=false&from=page\" type=\"application/x-shockwave-flash\"/></embed>", "other/26.png", "type", "other", "");
		this.createWork(64L, "《Turbo》", "Kone", "", "", "", "", "<embed src=\"http://www.tudou.com/v/rE3qlawExRk/&bid=05&resourceId=0_05_05_99/v.swf\" type=\"application/x-shockwave-flash\" allowscriptaccess=\"always\" allowfullscreen=\"true\" wmode=\"opaque\" width=\"100%\" height=\"563px\"></embed>", "other/27.png", "type", "other", "");
		this.createWork(65L, "《限时的遗忘》", "潘嘉丽", "", "", "", "", "<embed src=\"http://player.yinyuetai.com/video/player/46302/v_0.swf\" quality=\"high\" width=\"100%\" height=\"563px\" align=\"middle\"  allowScriptAccess=\"sameDomain\" allowfullscreen=\"true\" type=\"application/x-shockwave-flash\"></embed>", "other/28.png", "type", "other", "");
		this.createWork(66L, "《玉环》", "陈司翰", "", "", "", "", "<embed src=\"http://www.tudou.com/v/yksdmKa-5s8/&bid=05&rpid=610395566&resourceId=610395566_05_05_99/v.swf\" type=\"application/x-shockwave-flash\" allowscriptaccess=\"always\" allowfullscreen=\"true\" wmode=\"opaque\" width=\"100%\" height=\"563px\"></embed>", "other/29.png", "type", "other", "");
		this.createWork(67L, "《美好时光》", "潘安邦", "", "", "", "", "<embed src=\"http://player.ku6.com/refer/eYsVPwQXRbMN2iH-YhTqGA../v.swf\" width=\"100%\" height=\"563px\" allowscriptaccess=\"always\" allowfullscreen=\"true\" type=\"application/x-shockwave-flash\" flashvars=\"from=ku6\"></embed>", "other/30.png", "type", "other", "");
		this.createWork(68L, "《再见 Teresa》", "潘安邦", "", "", "", "", "<embed src=\"http://www.tudou.com/v/TLXgc9N92z8/&bid=05&rpid=610395566&resourceId=610395566_05_05_99/v.swf\" type=\"application/x-shockwave-flash\" allowscriptaccess=\"always\" allowfullscreen=\"true\" wmode=\"opaque\" width=\"100%\" height=\"563px\"></embed>", "other/31.png", "type", "other", "");
		this.createWork(69L, "《爱你之前》", "何俊明", "", "", "", "", "<embed width=\"100%\" height=\"563px\" wmode=\"Transparent\" allowfullscreen=\"true\" allowscriptaccess=\"always\" quality=\"high\" src=\"http://share.vrs.sohu.com/my/v.swf&topBar=1&id=20948113&autoplay=false&from=page\" type=\"application/x-shockwave-flash\"/></embed>", "other/32.png", "type", "other", "");
		logger.debug("初始化作品数据完成...");
	}
	
	private void createPoster(long id, String title, String description, String img, Long workId, int score) {
		Poster p = new Poster();
		p.setId(id);
		p.setTitle(title);
		p.setImg(img);
		p.setWorkId(workId);
		p.setDescription(description);
		p.setScore(score);
		p.setTs(clock.getCurrentDate());
		posterDao.save(p);
	}

	private void createWork(long id, String title, String author, String company, String description, String blog, String team, String url, String img, String type, String createDate, String tags) {
		Work work = new Work();
		work.setId(id);
		work.setTitle(title);
		work.setAuthor(author);
		work.setCompany(company);
		work.setDescription(description);
		work.setBlog(blog);
		work.setTeam(team);
		work.setUrl(url);
		work.setImg(img);
		work.setType(type);
		work.setCreateDate(createDate);
		work.setTags(tags);
		work.setTs(clock.getCurrentDate());
		workDao.save(work);
	}

}
